﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NeedMaterialHeaderEditFromSalesOrder.aspx.cs" Inherits="weba.Sales.NeedMaterialHeaderEditFromSalesOrder" %>

<%@ Register Assembly="C1.Web.Wijmo.Controls.4, Version=4.0.20133.145, Culture=neutral, PublicKeyToken=9b75583953471eea" Namespace="C1.Web.Wijmo.Controls.C1Input" TagPrefix="wijmo" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script type="text/javascript" >
        function OpenModalDialog(url) {
            var newWin = null;
            newWin = window.showModalDialog(url, window, 'dialogHeight:600px;dialogWidth:800px');
            if (newWin == null) {
                return;
            }
            newWin.open();
        }
   </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td height="30" background="../Images/tab_05.gif">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="12" height="30">
                                <img src="../Images/tab_03.gif" width="12" height="30" />
                            </td>
                            <td>
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="46%" valign="middle">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td>
                                                        <div align="center">
                                                            <img src="../images/tb.gif" width="16" height="16" /></div>
                                                    </td>
                                                    <td width="95%">
                                                        <span class="titleBold12px">管理用料单</span>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td width="54%" align="right">
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td width="16" height="30">
                                <img src="../Images/tab_07.gif" width="16" height="30" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="8" background="../images/tab_12.gif">
                                &nbsp;
                            </td>
                            <td>
                                <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td height="30" align="center">
                                            <strong>订单概况</strong>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="30" align="center">
                                            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="100" height="30" align="right">
                                                        合同号：
                                                    </td>
                                                    <td align="left">
                                                        <asp:Label ID="lblSalesOrderNumber" runat="server"></asp:Label>
                                                        <asp:Label ID="lblSalesOrderID" runat="server" Visible="False"></asp:Label>
                                                        <asp:Label ID="lblRootDepartmentID" runat="server" Visible="False"></asp:Label>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="100" height="30" align="right">
                                                        设计师：
                                                    </td>
                                                    <td align="left">
                                                        <asp:Label ID="lblDesigner" runat="server"></asp:Label>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="100" height="30" align="right">
                                                        备注：
                                                    </td>
                                                    <td align="left">
                                                        <asp:Label ID="lblNotesOrder" runat="server"></asp:Label>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="30" align="center">
                                        </td>
                                    </tr>
                                </table>
                                <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
                                    <ProgressTemplate>
                                        <img src="../Images/ajax-loader.gif" alt="" />数据载入中，请稍候...
                                    </ProgressTemplate>
                                </asp:UpdateProgress>
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                    <ContentTemplate>
                                        <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                                        <asp:Panel ID="pnlAdd" runat="server" Width="100%">
                                            
                                            <tr>
                                                <td width="100" height="30" align="right">
                                                    用料单日期：
                                                </td>
                                                <td>
                                                    <wijmo:C1InputDate ID="txtDateOrder" runat="server"></wijmo:C1InputDate>
                                                   <%-- <asp:TextBox ID="txtDateOrder" runat="server"></asp:TextBox>--%>
                                                    
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100" height="30" align="right">
                                                    经办人：
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblManagerUserName" runat="server" Visible="False"></asp:Label>
                                                    <asp:Label ID="lblManagerTrueName" runat="server"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2" align="center">
                                                    
                                                    <br />
                                                    <asp:Button ID="btnAddOrder" runat="server" Text="添加" OnClick="btnAddOrder_Click"
                                                        ValidationGroup="val" Font-Size="16px" Width="200px" Height="30px" />
                                                </td>
                                            </tr>
                                            </asp:Panel>
                                            <tr>
                                                <td Width="100%" >
                                                <asp:Label ID="lblMsg2" runat="server" ForeColor="Red"></asp:Label>
                                                    <br />
                                                    <hr />
                                                    <asp:CustomValidator ID="CustomValidator1" runat="server" Display="Dynamic" ErrorMessage="请至少添加一项用料单"
                                                        OnServerValidate="CustomValidator1_ServerValidate" ValidationGroup="ok"></asp:CustomValidator>
                                                    <br />
                                                    <asp:GridView ID="myGridView" runat="server" AutoGenerateColumns="False" Width="100%"
                                                        DataKeyNames="NeedMaterialID,Manager,StatusSubmit,StatusPurchaseMaterial" OnRowDeleting="myGridView_RowDeleting"
                                                        OnRowDataBound="myGridView_RowDataBound">
                                                        <Columns>
                                                            <asp:BoundField DataField="NeedMaterialID" HeaderText="ID"></asp:BoundField>
                                                            <asp:BoundField DataField="DateOrder" HeaderText="用料单日期" DataFormatString="{0:yyyy-MM-dd}"
                                                                HtmlEncode="False" />
                                                                <asp:TemplateField HeaderText="经办人">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="lblManagerName" runat="server"></asp:Label>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="提交状态">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="lblStatusSubmit" runat="server"></asp:Label>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="订货状态">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="lblStatusPurchaseMaterial" runat="server"></asp:Label>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="用料明细">
                                                                <ItemTemplate>
                                                                    <a href="javascript:void(0)" onclick="OpenModalDialog('NeedMaterialDetailEdit.aspx?NeedMaterialID=<%# Eval("NeedMaterialID") %>');">
                                                                        编辑</a>
                                                                </ItemTemplate>
                                                                <ItemStyle Width="60px" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="删除" ShowHeader="False">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="lbtnDel" runat="server" CausesValidation="False" CommandName="Delete"
                                                                        OnClientClick="return confirm(&quot;将删除此项目，且无法恢复，您确认删除此记录吗？&quot;)" Text="删除"></asp:LinkButton>
                                                                </ItemTemplate>
                                                                <ItemStyle Width="30px" />
                                                            </asp:TemplateField>
                                                        </Columns>
                                                    </asp:GridView>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="center" >
                                                    <br />
                                                    <asp:Button ID="btnOK" runat="server" Text="确定" OnClick="btnOK_Click" Font-Size="16px"
                                                        Width="200px" Height="30px" ValidationGroup="ok" />
                                                    <br />
                                                </td>
                                            </tr>
                                        </table>
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:PostBackTrigger ControlID="btnOK" />
                                    </Triggers>
                                </asp:UpdatePanel>
                            </td>
                            <td width="8" background="../images/tab_15.gif">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td height="35" background="../images/tab_19.gif">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="12" height="35">
                                <img src="../images/tab_18.gif" width="12" height="35" />
                            </td>
                            <td align="center">
                                &nbsp;
                            </td>
                            <td width="16">
                                <img src="../images/tab_20.gif" width="16" height="35" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
